package com.ruoyi.appointmentSet.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.appointmentSet.mapper.AppointmentSetMapper;
import com.ruoyi.appointmentSet.domain.AppointmentSet;
import com.ruoyi.appointmentSet.service.IAppointmentSetService;

/**
 * 预约设置Service业务层处理
 *
 * @author ch
 * @date 2022-07-26
 */
@Service
public class AppointmentSetServiceImpl implements IAppointmentSetService
{
    @Autowired
    private AppointmentSetMapper appointmentSetMapper;

    /**
     * 查询预约设置
     *
     * @param id 预约设置主键
     * @return 预约设置
     */
    @Override
    public AppointmentSet selectAppointmentSetById(Long id)
    {
        return appointmentSetMapper.selectAppointmentSetById(id);
    }

    /**
     * 查询预约设置列表
     *
     * @param appointmentSet 预约设置
     * @return 预约设置
     */
    @Override
    public List<AppointmentSet> selectAppointmentSetList(AppointmentSet appointmentSet)
    {
        return appointmentSetMapper.selectAppointmentSetList(appointmentSet);
    }

    /**
     * 新增预约设置
     *
     * @param appointmentSet 预约设置
     * @return 结果
     */
    @Override
    public int insertAppointmentSet(AppointmentSet appointmentSet)
    {
        appointmentSet.setCreateTime(DateUtils.getNowDate());
        return appointmentSetMapper.insertAppointmentSet(appointmentSet);
    }

    /**
     * 修改预约设置
     *
     * @param appointmentSet 预约设置
     * @return 结果
     */
    @Override
    public int updateAppointmentSet(AppointmentSet appointmentSet)
    {
        appointmentSet.setUpdateTime(DateUtils.getNowDate());
        return appointmentSetMapper.updateAppointmentSet(appointmentSet);
    }

    /**
     * 批量删除预约设置
     *
     * @param ids 需要删除的预约设置主键
     * @return 结果
     */
    @Override
    public int deleteAppointmentSetByIds(Long[] ids)
    {
        return appointmentSetMapper.deleteAppointmentSetByIds(ids);
    }


    /**
     * 批量逻辑删除预约设置
     *
     * @param ids 需要删除的预约设置主键
     * @return 结果
     */
    @Override
    public int logicDeleteAppointmentSet(Long[] ids,String delType,Long delUser)
    {
        return appointmentSetMapper.logicDeleteAppointmentSet(ids,delType,delUser);
    }

    /**
     * 删除预约设置信息
     *
     * @param id 预约设置主键
     * @return 结果
     */
    @Override
    public int deleteAppointmentSetById(Long id)
    {
        return appointmentSetMapper.deleteAppointmentSetById(id);
    }
}
